package oj0417.oj0417_02;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int size = (n * (n + 1))/2;
        int[] zData = new int[size];
        int[][] data = new int[n][n];
        //压缩数组赋值
        for (int i = 0; i < zData.length; i++) {
            zData[i] = sc.nextInt();
        }

        int index = 0;
        //对称矩阵赋值
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= i; j++) {
                data[i][j] = zData[index++];
                //非对角线，为对称矩阵堆成下标赋值
                if (i != j){
                    data[j][i] = data[i][j];
                }
            }
        }

//        输出
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++){
                if (j == 0){
                    System.out.print(data[i][j]);
                }else {
                    System.out.print(" " + data[i][j]);
                }
            }
            System.out.println();
        }

        sc.close();
    }
}
